#ifndef TCP_LOG_H

#define TCP_LOG_H
#include "J_http.h"
#include "esp_event.h"
#include "esp_log.h"
#include "esp_netif.h"
#include "esp_sntp.h"
#include "esp_system.h"
#include "esp_wifi.h"
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#include "freertos/queue.h"
#include "freertos/semphr.h"
#include "freertos/task.h"
#include "lwip/inet.h"
#include "lwip/netdb.h"
#include "lwip/sockets.h"
#include "ping/ping_sock.h"
#include <stdlib.h>
#include <string.h>

typedef enum {
    REMOTE_CLIENT = 1,
    REMOTE_SERVER
} role_t;

typedef struct {
    char IP[32];
    uint16_t port;
    int connect_fd;
    role_t role;
} J_tcp_connect_info_t;
#define TCP_INFO_SIZE 10
J_tcp_connect_info_t tcp_info_buff[TCP_INFO_SIZE];

void tcp_log_task(void* pvParameters);
void clear_tcp_info(int iFd);
uint8_t RS485_LOG; // 485报文日志
uint8_t ANA_LOG; // 数据类型解析日志
uint8_t MQTT_LOG; // mqtt响应日志
uint8_t HTTP_OPEN; // http开关
uint8_t MEM_LOG; // 打印内存大小
uint8_t PHY_LOG; // 打印PHY寄存器bit值
uint8_t TCP_LOG; // TCP协议层打印
#endif // !__TCP_LOG_H__
